<style>
    .tab {border-radius: 2px 2px 2px 2px;border: solid 1px #adadad;width: 81%; background-color: rgba(197, 197, 197, 0.25);
        height: auto; padding: 10px;  margin-top: -4%; }
</style>
<div class="page" data-ng-controller="updatePermission">
    <section class="panel panel-default">
        <div class="panel-heading"><strong><span
                class="glyphicon glyphicon-th"></span>&nbsp;&nbsp;&nbsp;&nbsp;修改权限</strong></div>
        <div class="panel-body">
            <div>
                <a onclick="pppre();" id="ppchoose1" class="btn btn-primary col-lg-2">修改权限</a><br/><br/>
                <a onclick="ppnext();" id="ppchoose2" class="btn btn-primary col-lg-2" disabled>设置菜单</a>
            </div>
            <form data-ng-submit="updatePer()">
                <div id="ppchange1" class="tab pull-right">
                    <div class="col-lg-8 form-horizontal form-validation">
                        <div class="form-group">
                            <div class="col-sm-3">
                                <label>选择修改权限</label>
                            </div>
                            <div class="col-sm-9" >
                                <select class="col-sm-12" data-ng-model="id" style="font-size: 14px;height:35px;"
                                        data-ng-options="m.id as m.perName for m in item"
                                        data-ng-change="getPerMenu()">
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-3">
                                <label>权限名称</label>
                            </div>
                            <div class="col-sm-9">
                                <input type="text"
                                       class="form-control"
                                       id="ppname"
                                       placeholder="权限名称不为空"
                                       data-ng-model="permission.perName"
                                       required>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-3">
                                <label>权限URL</label>
                            </div>
                            <div class="col-sm-9">
                                <input type="text"
                                       class="form-control"
                                       data-ng-model="permission.perUrl"
                                        >
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="col-sm-3">
                                <label>权限介绍</label>
                            </div>
                            <div class="col-sm-9">
                                <input type="text"
                                       class="form-control"
                                       data-ng-model="permission.perDesc"
                                        >
                            </div>
                        </div>
                    </div>
                </div>
                <div id="ppchange2" class="tab pull-right" hidden="hidden">
                    <table class="table table-hover">
                        <tr class="mail-unread" data-ng-repeat="info in menu">
                            <td style="width: 40px;"><label class="ui-checkbox"><input data-ng-model="info.check" name="checkbox1" type="checkbox"
                                                                  value="{{info.id}}"><span></span></label></td>
                            <td style="width: 40px;"><i class="fa {{info.icon}}"></i></td>
                            <td>{{info.title}}</td>
                            <td>{{info.url}}</td>
                            <td>{{info.parentName}}</td>
                            <td>{{info.moduleName}}</td>
                        </tr>
                    </table>
                </div>
                <div style="clear: right;margin-top: 15px;" class="pull-right">
                    <a onclick="pppre();" class="btn btn-primary">上一步</a>
                    <a id="ppnext" style="margin-left: 10px;" onclick="ppnext();ppchangeNext();"
                       class="btn btn-primary">下一步</a>
                    <input type="submit" id="ppfinish" value="完成" class="btn btn-primary"/>
                </div>
            </form>
        </div>
    </section>
</div>
<script>
    $(function () {
//        $("#ppnext").attr("disabled", true);
        $("#ppfinish").hide();
        $("#ppchoose1").css("background-color", "rgba(72, 205, 235, 0.45)");
    });
//    function ppsetNext() {
//        if ($("#ppname").val().trim().length > 0)
////        {$("#ppnext").attr("disabled", false);
//        }else {
//            $("#ppnext").attr("disabled", true);}
//    }
    function ppchangeNext() {
        $("#ppfinish").show();$("#ppnext").hide();
    }function ppnext() {
        $("#ppchange1").hide();$("#ppchange2").show();
        $("#ppchoose2").attr("disabled", false);$("#ppchoose2").css("background-color", "rgba(72, 205, 235, 0.45)");
        $("#ppchoose1").css("background-color", "");ppchangeNext();
    }function pppre() {
        $("#ppchange2").hide();$("#ppchange1").show();
        $("#ppchoose1").css("background-color", "rgba(72, 205, 235, 0.45)");$("#ppchoose2").css("background-color", "");
        $("#ppfinish").hide();$("#ppnext").show();
    }
</script>